-
Notifications
You must be signed in to change notification settings - Fork 2.2k
docs(auth): update examples to use modular API #8327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(auth): update examples to use modular API #8327
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
8b0286b
to
db17815
Compare
db17815
to
fa7de9b
Compare
fa7de9b
to
f2782c2
Compare
7fb2af3
to
293999c
Compare
Hello 👋, this PR has been opened for more than 2 months with no activity on it. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 15 days until this gets closed automatically |
Hi @mikehardy, IMHO the docs would still benefit from this PR. Thanks in advance for taking a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm 🤔 These aren't quite right though...
- currentUser is accessed as
auth.currentUser
on the return value ofgetAuth()
- all methods should be patterned as
methodName(getAuth(), <params>)
so there should never be an auth
import, and there shouldn't be any getAuth().methodName()
The modular
sections of the e2e test suites are the working examples at the moment
293999c
to
bb8d56f
Compare
bb8d56f
to
e1ffd61
Compare
Thanks for the feedback, @mikehardy ! I just finished rewriting this PR and incorporated newly available imports added with recently merged PRs (i.e. the auth providers are now importable).
Unfortunately, the auth module import is not quite gone yet since Similarly, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getting closer - sorry for the delay on review - but still documents a partial transition
I think a lot of the issues are easily fixed with current implementation and need to be fixed
There may be (likely is?) an implementation gap on the multi-factor stuff where we simply don't have the right APIs yet - either not exposing the MFA types for direct import yet or missing a method completely. I think these may be somewhat easy to fix in fact, and if they are missing I'd like to collaborate in fixing while getting this PR in
deprecating [edit: turns out auth.currentUser
and removing it is a breaking change so that is out of scope but documenting to access the user off credential or via getAdditionalUserInfo
is important I think so people use the correct style going forward<Auth>.currentUser
is still valid, I've modified all related comments below - no issue here with using .currentUser
e1ffd61
to
0566373
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool - thanks for doing this. I think documentation is easily as hard as code, and then when it's got code in it, doing it right is that much harder. This will be a big help for people
Lemme pull this locally and do the mindless lint / formatting stuff, it's all auto for me and I want to get this in |
For me, the scary part about docs is that tests usually don't catch errors/bugs in the code samples. I'm co-maintaining a quite popular Python project where we face the same issue. Someone recently opened a PR that adds tests to our CI checking whether code samples in the docs are self-contained and can be run as-is. Turns out most of our code samples are not self-contained, and we need a lot of extra work before we could potentially merge that PR.
No way I forgot to lint/format the docs again haha. I'm too spoiled by pre-commit hooks. |
just released the underlying code with the PR that makes this possible, so, good to go on the docs merge. Thanks again |
Description
This PR updates the authentication docs to use the modular API.
I just finished migrating an app to the modular API and put my insights into this PR hoping the next person can benefit from it.
Checklist
Android
iOS
e2e
tests added or updated inpackages/\*\*/e2e
jest
tests added or updated inpackages/\*\*/__tests__
Test Plan
I'll wait for the Vercel preview and then read the docs again. I already cross-checked the edits I made with my own code after the migration.
🔥
Think
react-native-firebase
is great? Please consider supporting the project with any of the below:React Native Firebase
andInvertase
on Twitter